#pragma once

#include "Structs.h"
#include "Utils.h"

#include <opencv2/opencv.hpp>

#ifdef _WIN32
#ifdef ISCLIBLIDAR_EXPORTS
#define ISCLIBLIDAR_API __declspec(dllexport)
#elif defined(DEMO_BUILD)
#define ISCLIBLIDAR_API  // 在demo模式下不使用导入/导出
#else
#define ISCLIBLIDAR_API __declspec(dllimport)
#endif
#else
#define ISCLIBLIDAR_API
#endif

class ISCLIBLIDAR_API ImageHandler
{
public:
    static void GetShoreLinePoints(std::string image_path);

    static void GetGrayImageHist(std::string imgae_path, const cv::Mat &image, cv::Mat &image_gray);

    static void TriThreshold(const cv::Mat &image, cv::Mat &image_thresh, int low_thresh = 80, int high_thresh = 180);

    static void RegionGrowing(const cv::Mat &image, cv::Mat &result_mask, cv::Point seed, float threshold = 30.0f, bool use_lab = false);

    static void GetCanny(const cv::Mat &image, cv::Mat &result_image, float threshold1 = 50.0f, float threshold2 = 150.0f, int apertureSize = 3);

    static void GetContours(const cv::Mat &image, cv::Mat &result_image);

    static void GetLabImage(std::string image_path, const cv::Mat &image, cv::Mat &thres_imagel);

    static void OtsuThresholdLAB(const cv::Mat &gray_image, cv::Mat &thres_image);
};